package model;

import java.io.Serializable;

/**
 *
 * @author Dustin
 */
public class Packet implements Serializable {
    public final static double TRESHHOLD = 0.4;

    private boolean isAck;
    private int seq;
    private String content;

    public Packet(int seq, String content) {
        this.seq = seq;
        this.content = content;

    }

    public Packet(boolean isAck, int seq) {
        this.isAck = isAck;
        this.seq = seq;
    }

    public int getSeq() {
        return seq;
    }

    public boolean isAck() {
        return isAck;
    }

    public String getContent() {
        return content;
    }

    public String toString() {
        String retval = "";
        retval += "<";
        retval += isAck ? "A:" : "D:";
        retval += "num=" + seq + ":";
        retval += "data=\"" + content + "\">";
        return retval;
    }
}
